home *** CD-ROM | disk | FTP | other *** search
- class ExplodableObstacle extends SideScroller.StaticObject
- {
- var mcRef;
- function ExplodableObstacle(__mcRef, __oLayer)
- {
- super(__mcRef,__oLayer);
- this.setState("Idle");
- }
- function onHit(__oRef)
- {
- if(this.CurrentState == "Idle")
- {
- TakGround(__oRef).doReactCollision();
- this.ParentLayer.doAddListener(this);
- this.setState("Explode");
- this.doLockState();
- }
- }
- function doDestroy()
- {
- this.ParentLayer.doRemoveListener(this);
- super.doDestroy();
- }
- function doExplode()
- {
- if(this.isStateComplete())
- {
- if(!this.mcRef.bStateAfterExplosion)
- {
- this.doDestroy();
- }
- else
- {
- this.doForcedSetState("ExplodedIdle");
- }
- }
- }
- }
-